package com.dao;

import java.sql.SQLException;
import java.util.List;

import com.util.JdbcTemplate;
import com.vo.MajorPlan;

public class MajorPlanDAOImpl implements MajorPlanDAO {
	private JdbcTemplate jdbcTemplate;
	public MajorPlanDAOImpl() {
		jdbcTemplate = new JdbcTemplate();
	}
	public boolean save(MajorPlan majorplan) throws SQLException {
		String sql = "insert into majorplan"
				+ "(majorId,majorName,trainingPurpose,trainingContent,classHours,teacher)"
				+"values(?,?,?,?,?,?)";
		
		int m=jdbcTemplate.update(sql, majorplan.getMajorId(), majorplan.getmajorName()
				,majorplan.getTrainingPurpose(),majorplan.getTrainingContent(),
				majorplan.getClassHours(),majorplan.getTeacher());
		
		if(m!= -1) {
			return true;
		}
		return false;
	}

	public int delete(int id) throws SQLException {
		return 0;
	}

	public int update(MajorPlan majorplan) throws SQLException {
		return 0;
	}

	public MajorPlan findById(int id) throws SQLException {
		return null;
	}

	public List<MajorPlan> find() throws SQLException {
		return null;
	}

}
